<%@page import="java.sql.Connection"%>
<%@page import="org.blackjuly.sign.data.SystemDataSource"%>
<%@page import="org.blackjuly.sign.entity.Comment"%>
<%@page import="org.blackjuly.sign.service.CommentService"%>
<%@page language="java" pageEncoding="utf-8"%>
<%@include file="auth.jsp"%>
<%
String from = request.getParameter("from");
Connection conn = SystemDataSource.getInstance().getConnection();
if(!from.equals("class")&&!from.equals("meeting"))response.setHeader("refresh", "0;URL=home.jsp");
CommentService commentService = new CommentService();
Comment comment = new Comment();
commentService.setConnection(conn);
Long num = commentService.findBestId(from);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查看评论</title>
<link rel="stylesheet" type="text/css" href="css/showComment.css" />
</head>

<body>
	<section class="comments">
	<%
	for(long i=1; i <= num; i++){
		comment = commentService.seeComment(from, i);
		if(comment.getStudent() ==null){
			continue;
		}
	%>
		<article class="comment">
			<a class="comment-img" href="#non">
				<img src="http://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=<%=comment.getQq()%>&src_uin=www.feifeiboke.com&fid=blog&spec=100" alt="" width="50" height="50">
			</a>
			<div class="comment-body">
				<div class="text">
					<p><%=comment.getContent()%></p>
				</div>
					<p class="attribution">by <a href="#non"><%=comment.getParent()%></a> at <%=comment.getTime()%></p>
			</div>
		</article>
	<%}%>
  </section>
  
</body>
</html>
